<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Create a new FDF document</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.fdf-close.html">fdf_close</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.fdf-enum-values.html">fdf_enum_values</a></div>
 <div class="up"><a href="ref.fdf.html">FDF 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.fdf-create" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">fdf_create</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">fdf_create</span> &mdash; <span class="dc-title">Create a new FDF document</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.fdf-create-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">resource</span> <span class="methodname"><strong>fdf_create</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   Creates a new FDF document. 
  </p>
  <p class="para">
   This function is needed if one would like to populate input fields in a
   PDF document with data.
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.fdf-create-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns a FDF document handle, or <strong><code>FALSE</code></strong> on error.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.fdf-create-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-3390">
    <p><strong>Example #1 Populating a PDF document</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$outfdf&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fdf_create</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">fdf_set_value</span><span style="color: #007700">(</span><span style="color: #0000BB">$outfdf</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"volume"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$volume</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">fdf_set_file</span><span style="color: #007700">(</span><span style="color: #0000BB">$outfdf</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"http:/testfdf/resultlabel.pdf"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fdf_save</span><span style="color: #007700">(</span><span style="color: #0000BB">$outfdf</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"outtest.fdf"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fdf_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$outfdf</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">Header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Content-type:&nbsp;application/vnd.fdf"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$fp&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">fopen</span><span style="color: #007700">(</span><span style="color: #DD0000">"outtest.fdf"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"r"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">fpassthru</span><span style="color: #007700">(</span><span style="color: #0000BB">$fp</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">unlink</span><span style="color: #007700">(</span><span style="color: #DD0000">"outtest.fdf"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.fdf-create-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.fdf-close.html" class="function" rel="rdfs-seeAlso">fdf_close()</a> - Close an FDF document</span></li>
    <li class="member"><span class="function"><a href="function.fdf-save.html" class="function" rel="rdfs-seeAlso">fdf_save()</a> - Save a FDF document</span></li>
    <li class="member"><span class="function"><a href="function.fdf-open.html" class="function" rel="rdfs-seeAlso">fdf_open()</a> - Open a FDF document</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.fdf-close.html">fdf_close</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.fdf-enum-values.html">fdf_enum_values</a></div>
 <div class="up"><a href="ref.fdf.html">FDF 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
